package com.music.peacerhythms.Uakj;

import android.content.Context;

import androidx.room.Database;
import androidx.room.Room;
import androidx.room.RoomDatabase;

import com.music.peacerhythms.info.MusicInfo;


@Database(entities = MusicInfo.class, version = 3, exportSchema = false)
public abstract class MusicDataBase extends RoomDatabase {

    public abstract MusicOperation musicOperation();

    public static final String DBNAME = "musicdatabase";
    private static MusicDataBase instance;

    public static MusicDataBase getInstance(Context context) {
        if (instance == null)
            instance = Room.databaseBuilder(context, MusicDataBase.class, DBNAME)
                    .allowMainThreadQueries()
                    .build();
        return instance;
    }

    public static void des() {
        instance = null;

    }

}